<nav id="main-dashboard-side-nav" class="hidden m:block" aria-label="Dashboards">
  <ul class="list-none p-0">
    <% if policy(Article).has_existing_articles_or_can_create_new_ones? %>
    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "show" && (params[:which] == "organization" || params[:which].blank?) %>"
        href="<%= dashboard_path %>"
        <%= @action == "show" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.posts") %>
        <span class="c-indicator"><%= @user.articles_count %></span>
      </a>
    </li>

    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "series" && (params[:which] == "organization" || params[:which].blank?) %>"
        href="<%= user_series_path(current_user.username) %>"
        <%= @action == "series" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.series") %>
        <span class="c-indicator"><%= @collections_count %></span>
      </a>
    </li>

    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "followers" %>"
        href="/dashboard/user_followers"
        <%= @action == "followers" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.followers") %>
        <span class="c-indicator"><%= @user.good_standing_followers_count %></span>
      </a>
    </li>
    <% end %>

    <li>
      <a class="crayons-link crayons-link--block js-following-tags-link <%= "crayons-link--current" if @action == "following_tags" %>"
        href="<%= dashboard_following_tags_path %>"
        <%= @action == "following_tags" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.following_tags") %>
        <span class="c-indicator"><%= @user.cached_followed_tag_names.size %></span>
      </a>
    </li>

    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "following_users" %>"
        href="<%= dashboard_following_users_path %>"
        <%= @action == "following_users" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.following_users") %>
        <span class="c-indicator"><%= @user.following_users_count %></span>
      </a>
    </li>

    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "following_organizations" %>"
        href="<%= dashboard_following_organizations_path %>"
        <%= @action == "following_organizations" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.following_orgs") %>
        <span class="c-indicator"><%= @user.following_organizations_count %></span>
      </a>
    </li>

    <li>
      <a class="crayons-link crayons-link--block <%= "crayons-link--current" if @action == "following_podcasts" %>"
        href="<%= dashboard_following_podcasts_path %>"
        <%= @action == "following_podcasts" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.following_pods") %>
        <span class="c-indicator"><%= @user.following_podcasts_count %></span>
      </a>
    </li>

    <%- if policy(Article).has_existing_articles_or_can_create_new_ones? %>
    <li>
      <a class="crayons-link crayons-link--block" href="<%= dashboard_analytics_path %>">
        <%= t("views.dashboard.actions.analytics") %>
      </a>
    </li>
    <%- end %>

    <li>
      <a class="crayons-link crayons-link--block js-hidden-tags-link <%= "crayons-link--current" if @action == "hidden_tags" %>"
        href="<%= dashboard_hidden_tags_path %>"
        <%= @action == "hidden_tags" ? ' aria-current="page"'.html_safe : "" %>>
        <%= t("views.dashboard.actions.hidden_tags") %>
        <span class="c-indicator"><%= @user.cached_antifollowed_tag_names.size %></span>
      </a>
    </li>

  <% if @organizations && (params[:which].blank? || params[:which] == "organization") %>
    <% @organizations.each do |org| %>
      <li>
        <a class="crayons-link crayons-link--block" href="<%= dashboard_analytics_org_path(org.id) %>"><%= t("views.dashboard.actions.for_org", org: org.name) %></a>
      </li>
    <% end %>
  <% end %>

  <% if policy(:video).new? %>
    <a class="crayons-btn crayons-btn--secondary w-100 mt-4" href="<%= new_video_path %>" data-no-instant><%= t("views.dashboard.actions.upload") %>
    </a>
  <% end %>
  </ul>
</nav>
